package kr.aow.ibatis;

import java.io.IOException;
import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class SqlMapClientFactory {
	private static SqlMapClient mapper;
	static{
		Reader reader;
		try {
			reader = Resources.getResourceAsReader("kr/or/ddit/ibatis/SqlMapConfig.xml");
			mapper = SqlMapClientBuilder.buildSqlMapClient(reader);
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
	
	public static SqlMapClient getSqlMapClient(){
		return mapper;
	}
}






